package com.iot.spi.exception;

import cn.hutool.core.util.StrUtil;

public class IotSpiException extends RuntimeException {
    /**
     * 错误码
     */
    private String code;
    /**
     * 错误消息
     */
    private String msg;

    public IotSpiException(String msg)
    {
        this.code = "10010";
        this.msg = msg;
    }
    public IotSpiException(String msg, Object... value)
    {
        this.code = "10010";
        this.msg = StrUtil.format(msg,value);
    }
    public IotSpiException(String code,String msg, Object... value)
    {
        this.code = code;
        this.msg = StrUtil.format(msg,value);
    }

    @Override
    public String getMessage()
    {
        return code+" : "+msg;
    }

}
